package com.yonyou.cyxdms.sysAuth.service.entity;

import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;

import java.io.Serializable;

/**
 * <p>
 * 系统固定代码
 * </p>
 *
 * @author quankk
 * @since 2019-07-05
 */
public class CodePO extends DMSBasePO<CodePO> {

    private static final long serialVersionUID = 1L;

    /**
     * 代码ID
     */

    private Integer codeId;
    /**
     * 代码类型(取CODE_ID前4位)
     */

    private Integer type;
    /**
     * 类型名称
     */

    private String typeName;
    /**
     * 代码英文名称
     */

    private String codeEnDesc;
    /**
     * 代码中文名称
     */

    private String codeCnDesc;
    /**
     * 排序
     */

    private Integer num;
    /**
     * 状态(10011001有效,10011002无效)
     */

    private Integer status;

    private Boolean isDeleted;

    public CodePO() {
        super();
    }


    public Integer getCodeId() {
        return codeId;
    }

    public void setCodeId(Integer codeId) {
        this.codeId = codeId;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getCodeEnDesc() {
        return codeEnDesc;
    }

    public void setCodeEnDesc(String codeEnDesc) {
        this.codeEnDesc = codeEnDesc;
    }

    public String getCodeCnDesc() {
        return codeCnDesc;
    }

    public void setCodeCnDesc(String codeCnDesc) {
        this.codeCnDesc = codeCnDesc;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Boolean getDeleted() {
        return isDeleted;
    }

    public void setDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    @Override
    protected Serializable pkVal() {
        return this.codeId;
    }

    @Override
    public String toString() {
        return "CodePO{" +
                "codeId=" + codeId +
                ", type=" + type +
                ", typeName=" + typeName +
                ", codeEnDesc=" + codeEnDesc +
                ", codeCnDesc=" + codeCnDesc +
                ", num=" + num +
                ", status=" + status +
                ", isDeleted=" + isDeleted +
                "}";
    }


    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author quankk
     * @since 2018/7/22 0022
     */
    protected <T extends BaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "codeId");
    }


}
